var nodemailer = require('nodemailer');

var config = require('./config.js');

var options = 'smtps://' + config.user + ':' + config.pass + '@' + config.host;
console.log(options);
var transpoter = nodemailer.createTransport(options);

function sendEmail(emailAddress, title, content) {
    var mailOptions = {
        from: config.user,
        to: emailAddress, // 多个地址用,分隔
        subject: title,
        text: 'text---',
        html: content
    };
    transpoter.sendMail(mailOptions, function (error, success) {
        if (error) {
            console.log(error);
        } else {
            console.log(success);
        }
    });
}

//sendEmail("284628487@qq.com", "title---", "你好---");
sendEmail("1376987173@qq.com", "title---", "<div style='color:#ff4400'>hh</div>");
